home *** CD-ROM | disk | FTP | other *** search
- // STree.h: Schnittstelle fⁿr die Klasse STree.
- //
- //////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_)
- #define AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- #include <GL\glu.h>
- #include "STexture.h"
-
-
- #define BAUM_HOEHE 0.5f
- #define BAUM_BREITE 0.35f
- #define STAMM_HOEHE 1.5f
- #define STAMM_BREITE 0.15f
- #define SPACE 1.0f
- #define MATRIX_SIZE 7
-
- enum STreeState
- {
- STATE_SHOWN,
- STATE_DRAGGING,
- STATE_HIDDEN,
- STATE_DESTROYING
- };
-
- class STree
- {
- public:
- STreeState getState();
- void setFinalPos(int xTest,int yTest);
- int* resolveFinalPos(float xTest, float yTest);
- int getYMatrixPos();
- int getXMatrixPos();
- void setState(STreeState state);
- bool click(float x, float y);
- void draw();
- void update(float frametime);
- void setPosition(float x, float y, float z);
- bool create(STexture* texBaum,STexture* texStamm);
- STree();
- virtual ~STree();
- protected:
- STexture* baum;
- STexture* stamm;
-
- float position[3];
- GLUquadricObj* quadric;
- STreeState treeState;
- int matrixPos[2];
- float rotation[2];
- float rotSpeed[2];
- float lastRealPos[2];
- float size;
- int destructionMethod;
- };
-
- #endif // !defined(AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_)
-